import request from '@/utils/request'

export function sysPermission() {
  return request({
    url: '/sys/permission',
    method: 'get'
  })
}
export function sysPermissionPost(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}
export function sysPermissionDelete(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'Delete'
  })
}
export function sysPermissionPut(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}
// 员工分配角色
export function sysUserAssignRoles(id, roleIds) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data: {
      id,
      roleIds
    }
  })
}
